<%@ page import="org.apache.ibatis.session.SqlSession" %>
<%@ page import="myschool.mybatisUtil.MybatisUtil" %>
<%@ page import="myschool.dao.StudentDao" %>
<%@ page import="com.github.pagehelper.PageHelper" %>
<%@ page import="myschool.entity.Student" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/6/5
  Time: 11:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table border="1">
<%
    SqlSession s= MybatisUtil.get();
    StudentDao mapper = s.getMapper(StudentDao.class);
    PageHelper.startPage(1,20);
    List<Student> students = mapper.paging2();
    MybatisUtil.close(s);
    for(Student stu:students) {
%>
<tr>
    <td><%=stu.getStuno()%></td>
    <td><%=stu.getSname()%></td>
    <td><%=stu.getSex()%></td>
    <td><%=stu.getTelephone()%></td>
    <td><%=stu.getWechat()%></td>
    <td><%=stu.getQq()%></td>
    <td><%=stu.getGradeid()%></td>
</tr>
<%}%>
    <iframe src="grade.jsp" width="300px" height="100px"></iframe>
</table>
</body>
</html>
